package com.un.ebs.contract.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.un.ebs.contract.domain.ContractExt;
import com.un.ebs.contract.domain.ContractItemExt;
import lombok.Data;

import java.util.List;

/**
 * @author liubo
 * @email liubocs@163.com
 * @date 2020/7/6 9:56
 */
@Data
public class ContractVo extends ContractExt {

    private String corpAddres;

    private String tel;

    private String taxNo;

    private String bankAccount;

    private String bankName;

    private Double taxMoney;

    private Double contractSumMoneyTax;

    private String contractSumMoneyTaxDesc;

    private String contractSumMoneyDesc;

    private List<ContractItemExt> items;

    public Double getTaxMoney() {
        return (getTaxRate()) * items.stream().mapToDouble(s -> s.getQty() * s.getPrice()).sum();
    }
}
